package com.mic.yzzn.plc.common.control.RMI;

import com.mic.yzzn.plc.common.control.datastructure.PLCCollectorControlCmd;
import com.mic.yzzn.plc.common.control.datastructure.PLCCollectorStatus;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;


/**
 * Created by ASH on 16/4/9.
 */
public interface PLCMaster extends Remote
{
    String NAME = "PLCMaster-RMI";


    /**
     * 通过指定的采集器ID批量获取采集器的状态信息
     * @param collectorIDs
     * @return 如果存在该采集器则返回状态信息,否则返回空
     * @throws RemoteException
     */
    public Map<String, PLCCollectorStatus> getCollectorStatesFromIDs(List<String> collectorIDs) throws RemoteException;

    /**
     * 通过指定的采集器ID获取采集器的状态信息
     * @param collectorID
     * @return 如果存在该采集器则返回状态信息,否则返回空
     * @throws RemoteException
     */
    public PLCCollectorStatus getCollectorStateFromID(String collectorID) throws RemoteException;

    /**
     * 通过采集器控制指令来控制采集器
     * @param cmd
     * @return 控制结果
     * @throws RemoteException
     */
    public int controlCollector(PLCCollectorControlCmd cmd) throws RemoteException;
}
